<template>
	<div id="addPosition">
		<h3 class="header-title clearfix">
			<span class="border"></span>
			<p v-show="checkshow">创建岗位</p>
			<p v-show="!checkshow">修改岗位</p>
		</h3>
		<div class="contentCenter" v-show="!xyshow">
			<div class="contentBox">
				<el-form :inline="true" :model="formInline" ref="addForm" :rules="rules" label-position="left">
					<!-- 加了一行 -->
					<el-row type="flex" class="row-bg" justify="space-between">
						<el-col :span="8">
							<el-form-item prop="selectDistricts">
								<pre class="formLabel">地        区</pre>
								<el-cascader class="cascader-box" ref="cascader" placeholder="选择/输入所属地区"
									:options="districtOption" v-model="formInline.selectDistricts"
									@change="districtChange" :props="districtProps" expand-trigger="hover"
									:show-all-levels="true" filterable>
									<i slot="suffix" class="el-input__icon el-icon-menu"></i>
								</el-cascader>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="address">
								<span class="formLabel">工作地点</span>
								<el-input v-model.trim="formInline.address" placeholder="请填写" class="formItem">
								</el-input>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="selectIndustrytypes">
								<pre class="formLabel">所属行业</pre>
								<el-cascader placeholder="输入/选择所属行业" :options="industrytypeOption"
									v-model="formInline.selectIndustrytypes" class="cascader-box selectIndustrytypes"
									@change="industrytypeChange" :props="industrytypeProps" expand-trigger="hover"
									:show-all-levels="false" filterable>
									<i slot="suffix" class="el-input__icon el-icon-menu"></i>
								</el-cascader>
							</el-form-item>
						</el-col>
					</el-row>
					<!-- 第一行 -->
					<el-row type="flex" class="row-bg" justify="space-between">
						<el-col :span="8">
							<el-form-item prop="selectFunctions">
								<pre class="formLabel">职       能 </pre>
								<el-cascader ref="cascader" placeholder="输入/选择职能" :options="functionOption"
									v-model="formInline.selectFunctions" class="cascader-box" @change="functionChange"
									:props="functionProps" expand-trigger="hover" :show-all-levels="false" filterable>
									<i slot="suffix" class="el-input__icon el-icon-menu"></i>
								</el-cascader>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="positionname">
								<pre class="formLabel">职       位</pre>
								<el-input v-model.trim="formInline.positionname" placeholder="请填写" class="formItem">
								</el-input>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="talenttype">
								<span class="formLabel">岗位类型</span>
								<!-- :disabled="formInline.typeDisplay" -->
								<el-select v-model="formInline.talenttype" disabled placeholder="请选择" class="formItem"
									@change="itemList(formInline.talenttype)">
									<el-option v-for="item in talentType" :key="item.dictid" :label="item.dictname"
										:value="item.dictid"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>
					<!-- 第二行 -->
					<el-row type="flex" class="row-bg" justify="space-between">
						<el-col :span="8">
							<el-form-item prop="recruitment">
								<span class="formLabel">招聘人数</span>
								<el-input v-model="formInline.recruitment" @keyup.native="proving" placeholder="请填写"
									min="1" class="formItem"></el-input>

								<!-- <el-input type="number" v-model.number="formInline.recruitment"   placeholder="请填写" min="1" class="formItem" :disabled="formInline.positionid !== '' && status === '1'"></el-input> -->
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="qualification">
								<pre class="formLabel">学历要求</pre>
								<el-select v-model="formInline.qualification" placeholder="请选择" class="formItem">
									<el-option v-for="item in educationList" :key="item.dictid" :label="item.dictname"
										:value="item.dictid"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="worklife">
								<span class="formLabel">工作经验</span>
								<el-select v-model="formInline.worklife" placeholder="请选择" class="formItem">
									<el-option v-for="item in WorkYearsList" :key="item.dictid" :label="item.dictname"
										:value="item.dictid"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>
					<!-- 第三行 -->
					<el-row type="flex" class="row-bg" justify="space-between" v-if="formInline.wagetype==='1'">
						<el-col :span="8">
							<div class="age-box">
								<el-form-item prop="minage" class="mixage-form form-box-select">
									<span class="formLabel">年龄范围</span>
									<el-select v-model="formInline.minage" placeholder="请选择"
										class="select-time mixage-select startage"
										@change="minageList(formInline.minage)">
										<el-option v-for="item in agelist" :key="item.index" :label="item"
											:value="item"></el-option>
									</el-select>
									<span class="line">—</span>
								</el-form-item>
								<el-form-item>
									<el-select v-model="formInline.maxage" placeholder="请选择" class="select-time maxage">
										<el-option v-for="item in maxagelist" :key="item.index" :label="item"
											:value="item"></el-option>
									</el-select>
								</el-form-item>
							</div>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="wagetype">
								<pre class="formLabel">薪资类型</pre>
								<el-select v-model="formInline.wagetype" placeholder="请选择" class="formItem"
									@change="wagetypeChange">
									<el-option v-for="item in wagetypeOption" :key="item.value" :label="item.label"
										:value="item.value"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="8" v-if="formInline.wagetype=='1'">
							<el-form-item v-if="flag">
								<span class="formLabel">薪资待遇</span>
								<!--    <el-select
	                  v-model="formInline.offer"
	                  placeholder="请选择"
	                  class="formItem"
	                  @change="salaryChange"
	                  filterable
	                  allow-create
	                  default-first-option
	                >
	                  <el-option
	                    v-for="item in salaryList"
	                    :key="item.dictid"
	                    :label="item.dictname"
	                    :value="item.remark1 + '-' + item.remark2"
	                  ></el-option>
	                </el-select>
	              </el-form-item>
	              <el-form-item  v-if="!flag">
	                <span class="formLabel">薪资待遇</span>
	               <el-input
	                  v-model="miniSalary"
	                  placeholder="最小值"
	                  type="text"
	                  class="miniSalary salary"
	                  @change="currentMim"
	                  min="10"
	                ></el-input>-
	                <el-input
	                  v-model="maxSalary"
	                  placeholder="最大值"
	                  type="text"
	                  class="salary"
	                  @change="currentMax"
	                  :min="+miniSalary+ 1"
	                ></el-input> -->

								<!-- <el-select  style="width: 145px;" 
					  v-model="miniSalary"  filterable allow-create filterable @change="salaryChange" >
						<el-option v-for="(i,k) in 1000" :value="i" :label="i+'k'"></el-option>
					</el-select>
					<el-select style="width: 145px;"  v-model="maxSalary" filterable allow-create filterable @change="salaryChange" >
						<el-option v-for="(i,k) in 1000" :value="i" :label="i+'k'">
						</el-option>
					</el-select> -->

								<el-input style="width: 145px;" v-model="miniSalary" @blur="salaryChange" type="text"
									oninput="value=value.replace(/[^\d]/g,'')">
									<template slot="append">k</template>
								</el-input>
								-
								<el-input style="width: 145px;" v-model="maxSalary" @blur="salaryChange" type="text"
									oninput="value=value.replace(/[^\d]/g,'')"> <template slot="append">k</template>
								</el-input>




							</el-form-item>
							<!-- <span
	                @click="userDefine"
	                v-show="this.flag"
	                class="user-defined"
	                v-if="status !== '1'"
	              >自定义</span>
	              <span
	                @click="userDefine"
	                v-show="!this.flag"
	                class="user-defined"
	                v-if="status !== '1'"
	              >取消自定义</span> -->
						</el-col>
					</el-row>
					<!-- 第三行 -->
					<el-row type="flex" class="row-bg" justify="space-between" v-if="formInline.wagetype==='2'"
						key="wagetype'2'">
						<el-col :span="8">
							<el-form-item prop="minage" class="mixage-form form-box-select">
								<span class="formLabel">年龄范围</span>
								<el-select v-model="formInline.minage" placeholder="请选择" class="select-time"
									@change="minageList(formInline.minage)">
									<el-option v-for="item in agelist" :key="item.index" :label="item" :value="item">
									</el-option>
								</el-select>
								<span class="line">—</span>
							</el-form-item>
							<el-form-item>
								<el-select v-model="formInline.maxage" placeholder="请选择" class="select-time">
									<el-option v-for="item in maxagelist" :key="item.index" :label="item" :value="item">
									</el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="wagetype">
								<pre class="formLabel">薪资类型</pre>
								<el-select v-model="formInline.wagetype" placeholder="请选择" class="formItem"
									@change="wagetypeChange">
									<el-option v-for="item in wagetypeOption" :key="item.value" :label="item.label"
										:value="item.value"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
						<el-col :span="8" id="selectTime" class="time-select-box form-box-select">
							<el-form-item prop="startTime">
								<span class="formLabel">工作时间段</span>
								<el-time-select class="select-time working-time" placeholder="起始时间"
									v-model="formInline.startTime" @change="selectTime"
									:picker-options="{start: '00:00', step: '00:30',end: '23:30'}"></el-time-select>
								<span class="time-line horizontal">—</span>
							</el-form-item>
							<el-form-item prop="endTime">
								<el-time-select class="select-time working-time" placeholder="结束时间"
									v-model="formInline.endTime" @change="selectTime"
									:picker-options="{start: '00:00', step: '00:30',end: '24:00', minTime: formInline.startTime}">
								</el-time-select>
							</el-form-item>
						</el-col>
					</el-row>
					<!-- 第四行月薪 -->
					<el-row type="flex" class="row-bg" v-if="formInline.wagetype==='1'" key="wagetype'1'">
						<!-- <el-row type="flex" class="row-bg" justify="space-between"  v-if="$route.query.status != '1'"> -->
						<el-col :span="8">
							<el-form-item>
								<span class="formLabel"></span>
								<el-input readonly v-model="payNum" placeholder="0.00元/人" class="formItem"></el-input>
							</el-form-item>
						</el-col>
						<!-- </el-row> -->
						<el-col :span="8">
							<el-form-item prop="entryday">
								<span class="formLabel">在职保障天数</span>
								<el-select v-model="formInline.entryday" placeholder class="entryday" disabled>
									<el-option label="formInline.entryday" value="formInline.entryday"></el-option>
								</el-select>
							</el-form-item>
						</el-col>
					</el-row>
					<!-- 第四行 -->
					<el-row type="flex" class="row-bg" v-if="formInline.wagetype==='2'">
						<el-col :span="8">
							<el-form-item prop="hourlyState" v-if="formInline.wagetype==='2'">
								<pre class="formLabel">工作性质</pre>
								<el-select v-model="formInline.hourlyState" filterable placeholder="1"
									style="width: 300px;">
									<el-option label="长期" value="1"></el-option>
									<el-option label="短期" value="2"></el-option>
								</el-select>
								<!-- <el-input
	                  v-model="formInline.workday"
	                  @keyup.native="workdayProving"
	                  :disabled="formInline.positionid !== '' && status === '1'"
	                  placeholder="请输入工作天数"
	                  class="formItem"
	                ></el-input> -->
							</el-form-item>
						</el-col>
						<!-- 时薪 -->
						<el-col :span="8" v-if="formInline.wagetype==='2'&&formInline.hourlyState=='1'">
							<el-form-item style="position: relative;">
								<span class="formLabel">工作日</span>
								<el-checkbox-group v-model="checkList" @change="selectDate"
									style="position:absolute;width:400px;top: 0;left: 75px;">
									<el-checkbox label="星期一"></el-checkbox>
									<el-checkbox label="星期二"></el-checkbox>
									<el-checkbox label="星期三"></el-checkbox>
									<el-checkbox label="星期四"></el-checkbox>
									<el-checkbox label="星期五"></el-checkbox>
									<el-checkbox label="星期六"></el-checkbox>
									<el-checkbox label="星期日"></el-checkbox>
								</el-checkbox-group>
							</el-form-item>
						</el-col>
						<el-col :span="8" v-if="this.formInline.wagetype==='2'&&formInline.hourlyState=='2'">
							<el-form-item prop="hourlywage"
								v-if="this.formInline.wagetype==='2'&&formInline.hourlyState=='2'">
								<span class="formLabel">选择日期</span>
								<el-date-picker format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd" type="dates"
									style="width: 300px;" @change="selectDate" v-model="demonstration"
									placeholder="选择一个或多个日期">
								</el-date-picker>
							</el-form-item>
						</el-col>
						<el-col :span="8">
							<el-form-item prop="hourlywage" style="margin-left: 45px;">
								<span class="formLabel">薪资待遇</span>
								<el-input style="width: 220px;" v-model="formInline.hourlywage" placeholder="请填写时薪薪资"
									class="formItem hourlywage-text"></el-input>元/小时
								<!-- <span class="unit-style">元/小时</span> -->
							</el-form-item>
						</el-col>
					</el-row>
					<el-row type="flex" class="row-bg" v-if="formInline.wagetype==='2'">
						<el-col :span="8">
							<el-form-item>
								<span class="formLabel">服务费用</span>
								<el-input readonly style="width: 220px;" v-model="payNum" placeholder="0.00元/人"
									class="formItem"></el-input>积分/工作日
							</el-form-item>
						</el-col>
					</el-row>
					<div class="row-bg welfareBox">
						<el-form-item prop="welfare" label="福利待遇">
							<el-checkbox-group style="margin-left: 20px; padding-right: 10px;" v-model="welfares"
								@change="welfaresChange" size="medium">
								<el-checkbox-button style="width: 120px; border: none;" v-for="item in welfareList"
									:label="item.dictid" :key="item.dictid">{{item.dictname}}</el-checkbox-button>
							</el-checkbox-group>
						</el-form-item>
					</div>


					<div class="row-bg" style="margin-left: 9px;">
						<el-form-item label="薪资结构" prop="salaryStructure">
							<!-- <quill-editor v-model="formInline.jobcontent" class="qeditor"></quill-editor> -->
							<el-input style="width: 1200px;" type="textarea" placeholder="请输入薪资结构" rows="5"
								v-model="formInline.salaryStructure" class="addPosition-textarea"></el-input>
						</el-form-item>
					</div>

					<div class="row-bg">
						<el-form-item label="职位描述" prop="jobcontent">
							<!-- <quill-editor v-model="formInline.jobcontent" class="qeditor"></quill-editor> -->
							<el-input style="width: 1218px;" type="textarea" :rows="5" placeholder="请输入职位描述"
								v-model="formInline.jobcontent" class="addPosition-textarea"></el-input>
						</el-form-item>
					</div>





					<!-- <div class="row-bg" v-show="false">
	            <el-form-item
	              label="任职要求"
	              prop="workduty"
	            > -->
					<!-- <quill-editor v-model="formInline.workduty" class="qeditor"></quill-editor> -->
					<!-- <el-input
	                type="textarea"
	                placeholder="请输入内容"
	                v-model="formInline.workduty"
	                class="addPosition-textarea"
	              ></el-input>
	            </el-form-item>
	          </div> -->
					<!-- <div class="row-bg payType">
	            <el-form-item
	              prop="paytype"
	              label="付费类型"
	            >
	              <el-radio-group v-model="formInline.paytype">
	                <el-radio-button
	                  style=""
	                  class="paymentType"
	                  label="2"
	                  :disabled="formInline.positionid !== '' && status === '1'"
	                >免费体验</el-radio-button>
	                <el-radio-button
	                  class="pr paymentType"
	                  v-if="$route.query.status == '2'"
	                  label="1"
	                  :disabled="formInline.positionid !== '' && status === '1'"
	                >{{`付费(需支付${Math.floor((+payNum || 0)*+(formInline.recruitment || 0)*+formInline.discount )}元)`}}</el-radio-button>
	                <el-radio-button
	                  class="pr paymentType"
	                  v-if="$route.query.status === '1' ||$route.query.status === '0'"
	                  label="1"
	                  :disabled="formInline.positionid !== '' && status === '1'"
	                >{{`付费(需支付${Math.floor((+timeNum || 0)*+(formInline.recruitment || 0)*+formInline.discount )}元)`}}</el-radio-button>
	                <img
	                  v-if="ishighquality==='0'"
	                  class="pa paytypeico"
	                  src="../../src/assets/img/8.png"
	                  alt=""
	                >
	                <img
	                  v-if="ishighquality==='1'"
	                  class="pa paytypeico"
	                  src="../../src/assets/img/9.png"
	                  alt=""
	                >
	              </el-radio-group>
	            </el-form-item>
	          </div>-->
					<!-- =================================================岗位建模 ==============================================-->
					<el-collapse v-show="false" v-model="activeName" accordion>
						<el-collapse-item style="font-size:24px;" title="岗位建模" name="1">
							<div>
								<div class="father">
									<p>
										*提示: 您对岗位的标准要求，根据下列“职业方向”和“动机状态”来选择，建议将
										<a>《岗位建模说明书》</a>打印，详读，再进行岗位建模，请慎重！
									</p>
									<p class="about">分数参考范围</p>
									<div class="block big">
										<el-slider v-model="value" range :show-stops="true" :step="10" :marks="marks">
										</el-slider>
									</div>
									<div class="midContent">
										<el-row>
											<el-col :span="12">
												<div class="grid-content bg-purple">
													<div class="left">
														<p class="leftOne">职业方向</p>
														<p class="leftTwo">* 请选择下列12项中的6项，拖动箭头选择分值“三主三辅”</p>
														<div class="block">
															<span class="demonstration">操作型</span>
															<el-slider v-model="direction[0].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">规划型</span>
															<el-slider v-model="direction[1].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">技能型</span>
															<el-slider v-model="direction[2].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">事务型</span>
															<el-slider v-model="direction[3].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">艺术型</span>
															<el-slider v-model="direction[4].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">发明型</span>
															<el-slider v-model="direction[5].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">人文型</span>
															<el-slider v-model="direction[6].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">服务型</span>
															<el-slider v-model="direction[7].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">管控型</span>
															<el-slider v-model="direction[8].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">开拓型</span>
															<el-slider v-model="direction[9].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">交际型</span>
															<el-slider v-model="direction[10].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">影响型</span>
															<el-slider v-model="direction[11].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
													</div>
												</div>
											</el-col>
											<el-col :span="12">
												<div class="grid-content bg-purple-light">
													<div class="right">
														<p class="leftOne">动机分析</p>
														<p class="leftTwo">* 请选择下列8项中的8项，拖动箭头以选取动机分析的分值要求</p>
														<div class="block">
															<span class="demonstration">财富</span>
															<el-slider v-model="motive[0].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">健康</span>
															<el-slider v-model="motive[1].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">享受</span>
															<el-slider v-model="motive[2].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">工作</span>
															<el-slider v-model="motive[3].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">权利</span>
															<el-slider v-model="motive[4].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">创新</span>
															<el-slider v-model="motive[5].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">情感</span>
															<el-slider v-model="motive[6].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
														<div class="block">
															<span class="demonstration">荣誉</span>
															<el-slider v-model="motive[7].value" show-input
																:show-input-controls="false" input-size="mini">
															</el-slider>
														</div>
													</div>
												</div>
											</el-col>
										</el-row>
									</div>
								</div>
							</div>
						</el-collapse-item>
					</el-collapse>

					<!-- ========================================================================================== -->
					<div class="row-bg">
						<span class="tips" v-if="this.formInline.wagetype=='1'">
							* 提示 : 1、优质企业享受九折优惠，知名企业享受八折优惠;
							<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、服务费用按月薪平均值小于6k平台收取300积分；大于等于6k小于10k平台收取600积分；大于等于10k小于20k平台收取700积分；大于等于20k小于30k平台收取800积分；大于等于30k
							平台收取900积分。
						</span>
						<span class="tips" v-if="this.formInline.wagetype=='2'">
							* 提示 : 1、优质企业享受九折优惠，知名企业享受八折优惠;
							<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2、服务费用按每日工作时长*工作天数*时薪待遇的5%收取，满8小时减扣1小时的休息时间，满12小时减扣2小时的休息时间，休息时间平台不收取服务费用。
						</span>
					</div>
				</el-form>
				<div v-show="formInline.wagetype==2" style="margin-top:10px;">
					<el-checkbox v-model="formInline.checked">我已阅读并同意</el-checkbox>
					<span class="service-statement" @click="LINKTOSERVICESTATEMENT()">非全日制用工积分扣除协议</span>
				</div>
				<div class="submitBox">
					<el-button @click="goback" size="mini">取消</el-button>
					<el-button type="primary" @click="submitForm('addForm')" size="mini" v-preventReClick>发布
					</el-button>
				</div>
				<!-- <cityDialog v-if="this.$store.state.cityDialog.isVisible"></cityDialog> -->
			</div>
		</div>
		<!-- <jfxy
	      v-show="xyshow"
	      @change="currentXyshow"
	    ></jfxy> -->
	</div>
</template>
<script src="./addPosition.js">
</script>
<style src="./addPosition.css" scoped>
